import request from '@/utils/request.js';

// 查询基础设置
export function getBaseSet(type){
	return request.get('spoken/baseSet/' + type, {}, true)
}

// 查询首页模块
export function getHomeModule(data){
	return request.get('spoken/home/list', data, true)
}

// 查询问答
export function getQa(data){
	return request.get('spoken/qa/list', data)
}

// 查询问答详情
export function getQaById(id){
	return request.get('spoken/qa/' + id, null, true)
}

// 查询教师列表
export function getTeacherList(data){
	return request.get('spoken/teacher/list', data, true)
}

// 查询教师分类
export function getTeacherTagList(data){
	return request.get('spoken/teacherTag/list', data, true)
}

// 查询教师详情
export function getTeacherInfo(teacherId){
	return request.get('spoken/teacher/getById/' + teacherId, {}, true)
}

// 查询课程分类
export function getCourseTagList(data){
	return request.get('spoken/courseTag/list', data, true)
}

// 查询课时包
export function getLessonNumList(data){
	return request.get('spoken/lessonNum/list', data, true)
}

// 查询没有课的日期
export function getDisabledDate(data){
	return request.post('spoken/teacher/disabledDate', data, true)
}

// 根据日期和教师查询时间段
export function getTimeList(data){
	return request.post('spoken/teacher/timeList', data, true)
}

// 创建订单
export function createOrder(data){
	return request.post('spoken/order', data, true)
}

// 根据订单ID查询订单
export function getOrderInfo(orderId){
	return request.get('spoken/order/' + orderId, {}, true)
}

// 支付
export function orderPay(orderId){
	return request.get('spoken/order/toPay/' + orderId, {}, true)
}

// 订单列表
export function getOrderList(data){
	return request.get('spoken/order/list', data, true)
}

// 取消订单
export function cancelOrder(id){
	return request.get('spoken/order/cancel/' + id, {}, true)
}

// 删除订单
export function delOrder(id){
	return request.delete('spoken/order/' + id, {}, true)
}
